import request from '@/utils/request'

// 查询薪酬运算列表列表
export function listOperation(query) {
  return request({
    url: '/salary/salaryCalculation/list',
    method: 'get',
    params: query
  })
}

// 查询薪酬运算列表详细
export function getOperation(id) {
  return request({
    url: '/salary/salaryCalculation/' + id,
    method: 'get'
  })
}

// 删除薪酬运算列表
export function delOperation(id) {
  return request({
    url: '/salary/salaryCalculation/' + id,
    method: 'delete'
  })
}

//保存计薪范围

export function saveSalaryRange(data) {
  return request({
    url: '/salary/salaryCalculation/saveSalaryRange',
    method: 'post',
    data: data
  })
}

//查询薪酬运算雇员列表
export function getSalaryCalculationEmpList(query){
  return request({
    url: '/salary/salaryCalculation/getSalaryCalculationEmpList',
    method: 'get',
    params: query
  })
}

//薪酬运算—雇员列表
export function getEmpListBySalaryGroup(query){
  return request({
    url: '/salary/salaryCalculation/getEmpListBySalaryGroup',
    method: 'get',
    params: query
  })
}


//新增雇员
export function addSalaryCalculationEmp(data){
  return request({
    url: '/salary/salaryCalculation/addSalaryCalculationEmp',
    method: 'post',
    data: data
  })
}

//删除雇员
export function removeEmp(salaryCalculationEmpId){
  return request({
    url: `/salary/salaryCalculation/removeEmp/${salaryCalculationEmpId}`,
    method: 'post'
  })
}


//新增薪酬项目
export function addSalaryCalculationProject(data){
  return request({
    url: '/salary/salaryCalculation/addSalaryCalculationProject',
    method: 'post',
    data: data
  })
}

//调整状态
export function saveSalaryCalculation(data){
  return request({
    url: '/salary/salaryCalculation/saveSalaryCalculation',
    method: 'post',
    data: data
  })
}



//同步考情数据
export function synchronizeAttendanceData(salaryCalculationId){
  return request({
    url: `/salary/salaryCalculation/synchronizeAttendanceData/${salaryCalculationId}`,
    method: 'post'
  })
}

//运算/重新运算
export function calculation(salaryCalculationId){
  return request({
    url: `/salary/salaryCalculation/calculation/${salaryCalculationId}`,
    method: 'post'
  })
}

//生成薪酬报告
export function createSalaryReport(salaryCalculationId){
  return request({
    url: `/salary/salaryCalculation/createSalaryReport/${salaryCalculationId}`,
    method: 'post'
  })
}

//发放工资单
export function payrollDistribution(salaryCalculationId){
  return request({
    url: `/salary/salaryCalculation/payrollDistribution/${salaryCalculationId}`,
    method: 'post'
  })
}


//数额调整——列表编辑
export function updateAmountAdjustment(data){
  return request({
    url: `/salary/salaryCalculation/updateAmountAdjustment`,
    method: 'post',
    data: data
  })
}

//运算——列表编辑
export function updateCalculation(data){
  return request({
    url: `/salary/salaryCalculation/updateCalculation`,
    method: 'post',
    data: data
  })
}







